<template>
  <view class="meeting-record">
    <Tags class="tags" :data="detail" />
    <view class="meeting-code">
      <view class="label">会议编号：</view>
      <view>{{ detail.meetingCode }}</view>
    </view>
    <uni-collapse @change="onChange">
      <CollapseItem :show-arrow="false" title-border="none" title="基本信息" index="0" :indexList="indexList">
        <BaseInfo :data="detail" />
      </CollapseItem>

      <CollapseItem :show-arrow="false" title-border="none" title="会议记录" index="1" :indexList="indexList">
        <MeetingRecord :data="detail" :meetingNodeType="meetingNodeType" />
        <ZhRecord :data="detail" :meetingNodeType="meetingNodeType" />
        <MeetingSpeak v-if="detail.leaderTalkList && detail.leaderTalkList.length" :data="detail" />
      </CollapseItem>

      <CollapseItem
        v-show="detail.hasLeader == 1"
        :show-arrow="false"
        title-border="none"
        title="会议评分"
        index="2"
        :indexList="indexList"
      >
        <MeetingScoring :data="detail" />
      </CollapseItem>
    </uni-collapse>
  </view>
</template>

<script>
import Tags from './components/Tags.vue'
import BaseInfo from './components/BaseInfo.vue'
import CollapseItem from './components/CollapseItem.vue'
import MeetingRecord from './components/MeetingRecord.vue'
import MonitorConfirm from './components/MonitorConfirm.vue'
import MeetingScoring from './components/MeetingScoring.vue'
import ZhRecord from './components/ZhRecord.vue'
import MeetingSpeak from './components/MeetingSpeak.vue'
import { detail } from '@/api/duty-basic/duty-meeting'
export default {
  name: 'MeetingRecordMain',
  data() {
    return {
      indexList: ['0', '1', '2', '3', '4'],
      detail: {},
      type: 1, //进行中 2 已完成
      meetingNodeType: -1,
    }
  },
  components: { Tags, BaseInfo, CollapseItem, MeetingRecord, MonitorConfirm, MeetingScoring, ZhRecord, MeetingSpeak },
  methods: {
    onChange(e) {
      this.indexList = e
    },
    async getDetail(id) {
      const { data = {} } = await detail(id)
      this.detail = data
    },
  },
  onLoad({ id, meetingNodeType, type }) {
    id && this.getDetail(id)
    this.type = type
    this.meetingNodeType = meetingNodeType
  },
}
</script>

<style lang="scss" scoped>
.meeting-record {
  .tags {
    margin-top: 30rpx;
  }

  padding-bottom: 30rpx;
}
.meeting-code {
  padding: 10px 15px;
  display: flex;
  color: #333;
  .label {
    width: 77px;
    text-align: right;
  }
}

.uni-collapse-item-title {
  background: rgb(245, 245, 245);
  padding: 20rpx 30rpx;
  box-sizing: border-box;
  font-size: 26rpx;
  font-family: PingFang SC-Regular, PingFang SC;
  font-weight: 400;
  color: #999999;
}
</style>
